<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        
    </style>
</head>
<body>
    
    <script>
 		var str = '<a href="http://www.baiduc2.com">aaa</a><a href="http://www.baiduc2.com">aaa</a><a href="http://www.baiduc3.com">aaa</a>';
 		var patt;
        patt = new RegExp('((http)(://.*?"))','g');
        var replaceStr = '$2s$3';
        var newStr = str.replace(patt,replaceStr);
        console.log(newStr);

    </script>
</body>
</html>